package org.wlgzs.sjl.红黑树;

import java.util.Scanner;

/**
 * @author wlgzs-sjl
 * @date 2021/2/26 23:51
 */
public class RBTreeTest {
    public static void main(String[] args) {
        RBTree<String,Object> rbt=new RBTree<>();
        Scanner sc=new Scanner(System.in);
        while (true){
            System.out.println("请输入order:");
            String order=sc.next();
            System.out.println("请输入key:");
            if (order.equals("1")){
                String key=sc.next();
                rbt.insert(key,null);
            }else if (order.equals("2")){
                String key=sc.next();
                rbt.delete(key);
            }
            TreeOperation.show(rbt.getRoot());
        }
    }
}
